package cn.com.sbell.vss.csg.vap;

import java.util.HashMap;
import java.util.Map;

import org.dom4j.Element;

import cn.com.sbell.vss.VssConstants;
import cn.com.sbell.vss.VssException;
import cn.com.sbell.vss.csg.vap.bean.PTZRegress;
import cn.com.sbell.vss.csg.vsclient.VsClient;
import cn.com.sbell.vss.csg.vsclient.util.BeanValidator;
import cn.com.sbell.vss.csg.vsclient.util.PropertiesHolder;

public class SetPTZRegress extends ProtectedVsCommander{

	@Override
	protected Element executeCommand(VsClient vsClient,
			PropertiesHolder holder, Element root) {	
		PTZRegress regress=(PTZRegress)holder.populate(new PTZRegress());
		BeanValidator.validateNotNull(holder,
				new String[]{"ptzId","enableRegress"});
		if(!vsClient.setPTZRegress(regress)){
			throw new VssException(VssConstants.CODE_VS_SET_PTZREGRESS_FAILED);
		}
		return root;
	}
	
//	public static void main(String[] args) {
//		System.out.println("begin");
//		Map map = new HashMap();		
//		map.put("enableRegress", new String[] { "1" });
//		PropertiesHolder holder = new PropertiesHolder(map);
//		PTZRegress regress = new PTZRegress();
//		BeanValidator.validateNotNull(holder,new String[]{"enableRegress"});
//	}

}
